package com.example.app.moudle.home.adapter

import com.chad.library.adapter4.BaseMultiItemAdapter
import com.example.app.moudle.home.HomeF
import com.example.app.moudle.home.adapter.vh.FollowPageAdapter
import com.example.app.moudle.home.adapter.vh.RecommendPageAdapter
import com.example.app.moudle.home.adapter.vh.SpecialPageAdapter
import com.example.app.moudle.home.entity.HomeTabEntity
import com.example.app.moudle.home.vm.HomeVM

/**
 * Created on 2023/1/31.
 * @author Joker
 * Des: 多布局
 */

class HomeMultiAdapter(homeF: HomeF) : BaseMultiItemAdapter<HomeTabEntity>() {

    init {
        addItemType(HomeTabEntity.TAB_FOLLOW, FollowPageAdapter(homeF))
            .addItemType(HomeTabEntity.TAB_RECOMMEND, RecommendPageAdapter(homeF))
            .addItemType(HomeTabEntity.TAB_SPECIAL, SpecialPageAdapter(homeF))
            .onItemViewType { pos, list -> list[pos].tabId }
    }
}